-- GENERATED SPELL FOR [Negatron] --


function spell0_19851(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(35570,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_19851', 2314, 1)
end

function spell1_19851(pUnit, Event) --@Demolish,n/a--
pUnit:FullCastSpellOnTarget(34625,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_19851', 5259, 1)
end

function spell2_19851(pUnit, Event) --@Earthquake,Self--
pUnit:FullCastSpellOnTarget(35565,pUnit)
pUnit:RegisterEvent('Sorts_19851', 8000, 1)
end

function spell3_19851(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(34624,pUnit)
pUnit:RegisterEvent('Sorts_19851', 6313, 1)
end

function Sorts_19851(pUnit, Event)
local choix_sorts_19851 = math.random(0, 3)
if choix_sorts_19851 == 0 then
pUnit:RegisterEvent('spell0_19851', 1, 1)
end
if choix_sorts_19851 == 1 then
pUnit:RegisterEvent('spell1_19851', 1, 1)
end
if choix_sorts_19851 == 2 then
pUnit:RegisterEvent('spell2_19851', 1, 1)
end
if choix_sorts_19851 == 3 then
pUnit:RegisterEvent('spell3_19851', 1, 1)
end
end

function mob19851_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_19851', math.random(1500, 3000), 1)
end

function mob19851_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob19851_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob19851_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(19851, 1, 'mob19851_Action')
RegisterUnitEvent(19851, 2, 'mob19851_Leave')
RegisterUnitEvent(19851, 3, 'mob19851_Kill')
RegisterUnitEvent(19851, 4, 'mob19851_Die')
